//
//  WeatherNumberMeaningTransform.m
//  BiuWeather
//
//  Created by 楼楚 on 16/3/5.
//  Copyright © 2016年 Chu Lou. All rights reserved.
//

#import "WeatherNumberMeaningTransform.h"

@implementation WeatherNumberMeaningTransform

+ (NSString *)fontTextWeatherNumber:(NSNumber *)number {
   /*
    和风天气
    
     */
    
    NSString *weatherText = nil;
    
    
    switch (number.intValue) {
            
            // Extreme + Additional
        case 212:
            weatherText = @"e";
            break;
            
        case 901:
            weatherText = @"o";
            break;
            
        case 900:
            weatherText = @"h";
            break;
            
        case 200:
            weatherText = @"a";
            break;
            
        case 304:
            weatherText = @"W";
            break;
            
        case 201:
            weatherText = @"B";
            break;
            
        case 202:
        case 203:
        case 204:
        case 205:
        case 206:
            weatherText = @"Z";
            break;
            
        case 207:
        case 208:
        case 209:
        case 210:
        case 211:
        case 213:
            weatherText = @"Y";
            break;
            
            
            // Thunderstorm
        case 302:
        case 303:
            weatherText = @"T";
            break;
        
        case 305:
        case 309:
            weatherText = @"R";
            break;
            
        case 306:
        case 307:
        case 308:
        case 310:
        case 311:
        case 312:
            weatherText = @"S";
            break;
            
        case 300:
        case 301:
            weatherText = @"X";
            break;
            
            
            // Snow
        case 400:
        case 401:
        case 402:
        case 403:
        case 404:
        case 405:
        case 406:
        case 407:
              weatherText = @"W";
            break;
            
            
        case 500:
            weatherText = @"N";
            break;
            
        case 501:
        case 502:
        case 503:
            weatherText = @"G";
            break;
            
        case 504:
        case 506:
            weatherText = @"O";
            break;
            
        case 507:
        case 508:
            weatherText = @"e";
            break;

        case 100:
            weatherText = @"A";
            break;
            
        case 102:
        case 103:
            weatherText = @"C";
            break;
            
        case 101:
        case 104:
            weatherText = @"D";
            break;
            
            
            
        default:
            // 未知的情况
            weatherText = @"p";
            break;
    }
    
    
    return weatherText;
}

+ (UIColor *)iconColor:(NSNumber *)number {
    UIColor *color = nil;
    
    
    switch (number.intValue) {
            
        case 200:
        case 201:
        case 202:
        case 203:
        case 204:
        case 205:
        case 206:
        case 207:
        case 208:
        case 209:
        case 210:
        case 211:
        case 212:
        case 213:
        case 300:
        case 301:
        case 302:
        case 303:
        case 304:
        case 305:
        case 306:
        case 307:
        case 308:
        case 309:
        case 310:
        case 311:
        case 312:
        case 313:
        case 500:
        case 501:
        case 502:
        case 503:
        case 504:
        case 505:
        case 506:
        case 507:
        case 508:
        case 900:
        case 901:
        case 520:
        case 999:
            color = [UIColor redColor];
            break;
            
            
            // Snow
        case 400:
        case 401:
        case 402:
        case 403:
        case 404:
        case 405:
        case 406:
        case 407:
            color = COLOR_PURE_;
            break;
            
            
            // Clouds
        case 100:
        case 101:
        case 102:
        case 103:
        case 104:
            color = [UIColor orangeColor];
            break;
            
            
            
        default:
            // 未知的情况
            color = [UIColor blackColor];
            break;
    }
    
    
    return color;
    
}

+ (EMitterType)emitterTypeWithNumber:(NSNumber *)number {
    
    EMitterType type = __NONE;
    
    switch (number.intValue) {
            
            // Extreme + Additional
        case 100:
        case 101:
        case 102:
        case 103:
        case 104:
        case 200:
        case 201:
        case 202:
        case 203:
        case 204:
        case 205:
        case 206:
        case 207:
        case 208:
        case 209:
        case 210:
        case 211:
        case 212:
        case 213:
        case 500:
        case 501:
        case 502:
        case 503:
        case 504:
        case 505:
        case 506:
        case 507:
        case 508:
        case 900:
        case 901:
        case 520:
        case 999:
            break;
            
            
            // Thunderstorm
        case 300:
        case 301:
        case 302:
        case 303:
        case 304:
        case 305:
        case 306:
        case 307:
        case 308:
        case 309:
        case 310:
        case 311:
        case 312:
        case 313:
            type = __RAIN;
            break;
            
            
      
            // Snow
        case 400:
        case 401:
        case 402:
        case 403:
        case 404:
        case 405:
        case 406:
        case 407:
            type = __SNOW;
            break;
            
            
            
       
            
            
            
        default:
            // 未知的情况
            break;
    }
    
    return type;
}

@end
